﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CNVP.JShop.UI;
using CNVP.Config;
using CNVP.Framework.Utils;


namespace CNVP.JShop.Web.Admin.Template
{
    public partial class Search : AdminPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!BLL.BLLCheckAdmin.LoginOk(Page, 118)) return;//判断页面权限
            LitSearchTemplateSet.Text = TemplateShowSet(3);
        }
        private string TemplateShowSet(int TemplateType)
        {
            StringBuilder Str = new StringBuilder();
            CNVP.JShop.BLL.CNVP_Template bll = new CNVP.JShop.BLL.CNVP_Template();
            DataTable Dt = bll.GetTemplateInfo(0, TemplateType, UIConfig.TemplateUse);
            if (Dt != null && Dt.Rows.Count > 0)
            {
                Str.Append("<a href=\"#\" onclick=\"TemplateDel(" + Dt.Rows[0]["TemplateID"].ToString() + ")\">[-]</a>");
                Str.Append("<a href=\"#\" onclick=\"OpenWindow(0," + TemplateType + ")\">[s]</a>");
                LitTemplateFile.Text = Dt.Rows[0]["TemplateUrl"].ToString();
            }
            else
            {
                Str.Append("<a href=\"#\" onclick=\"TemplateSelect(0," + TemplateType + ");\">[+]</a>");
            }
            
            return Str.ToString();
        }
    }
}